<#assign tableid=auth.getuuid()>
<#assign formid=auth.getuuid()>
<script type="text/javascript">
function savetable(){
	$.CurrentNavtab.find('#${formid}').submit();
}
</script>
<div class="bjui-pageHeader">
	<form id="pagerForm" data-toggle="ajaxsearch" action="${rootpath}/System/user" method="post">
        <input type="hidden" name="pageSize" value="${(page.pageSize)!30}">
        <input type="hidden" name="pageCurrent" value="${(page.pageCurrent)!1}">
        <input type="hidden" name="orderField" value="${(page.orderField)!"name"}">
        <input type="hidden" name="orderDirection" value="${(page.orderDirection)!"asc"}">
        
        <div class="bjui-searchBar">
        	<#if auth.getauth(userid,"/System/user_save")>
        	<button type="button" class="btn-green" data-toggle="tableditadd" data-target="#${tableid}" data-num="1" data-icon="plus">添加行</button>&nbsp;
            <button type="button" class="btn-blue" onclick="savetable();" data-icon="save">保存修改</button>&nbsp;
            </#if>
            <label>工号：</label><input type="text" value="${no!}" name="no" size="10" />&nbsp;
            <label>姓名：</label><input type="text" value="${name!}" name="name" size="8" />&nbsp;
            <button type="submit" class="btn-default" data-icon="search">查询</button>&nbsp;
            <a class="btn btn-orange" href="javascript:;" onclick="$(this).navtab('reloadForm', true)" data-icon="undo">清空查询</a>&nbsp;
            <div class="alert alert-info search-inline"><i class="fa fa-info-circle"></i> 双击行可编辑</div>&nbsp;
            <div class="pull-right">
                <a onclick="printtask('${formid}')" class="btn btn-blue">打印表格</a>
            </div>
        </div>
        
    </form>
</div>
<div class="bjui-pageContent tableContent">
    <form action="${rootpath}/System/user_save" id="${formid}" class="pageForm" data-toggle="validate" method="post" data-reload="true">
        <table id="${tableid}" class="table table-bordered table-hover table-striped table-top" data-toggle="tabledit" data-initnum="0" data-layout-h="0">
            <thead>
                <tr>
                    <th data-order-field="id" title="ID"><input type="text" name="#index#*id" readonly value="" size="10"></th>
                    <th data-order-field="no" title="工号"><input type="text" name="#index#*no" data-rule="required" value="0000" size="10"></th>
                    <th data-order-field="name" title="姓名"><input type="text" name="#index#*name" data-rule="required" value="新用户名称" size="70"></th>
                	<th data-order-field="status" title="状态"><select name="#index#*status" data-toggle="selectpicker" data-rule="required"><option value="启用">启用</option><option value="禁用">禁用</option></select></th>
                	<th data-order-field="expirytime" title="失效日期"><input type="text" name="#index#*expirytime" class="j_custom_indate"  data-toggle="datepicker" data-rule="date" value="" size="10"></th>
                	<th title="操作" data-addtool="true" width="100">
                		<#if auth.getauth(userid,"/System/user_save")>
                		<a href="javascript:;" class="btn btn-red row-del" data-confirm-msg="确定要删除该行信息吗？">删除</a>
                		</#if>
                	</th>
                	<th  style="display:none;" title="_rowstatus"><input type="text" name="#index#*_rowstatus" value="Normal"></th>
                </tr>
            </thead>
            <tbody>
                <#if (page.pageData)?exists>
	                <#list page.pageData as item>
	                	<#if item?exists>
	                		<tr data-id="${item.id!}">
				                <td>${item.id!}</td>
				                <td>${item.no!}</td>
				                <td>${item.name!}</td>
				                <td data-val="${item.status!}">${item.status!}</td>
				                <td>${item.expirytime!}</td>
				                <td data-noedit="true">
				                	<#if auth.getauth(userid,"/System/user_save")>
                        			<a href="javascript:;" class="btn btn-red row-del" data-confirm-msg="确定要删除该行信息吗？">删除</a>
                    				</#if>
                    			</td>
                    			<td style="display:none;">Normal</td>
				            </tr>
	                	</#if>
	                </#list>
            	</#if>
            </tbody>
        </table>
 	</form>
    <div class="bjui-pageFooter">
		<div class="pages">
			<span>每页&nbsp;</span>
			<div class="selectPagesize">
				<select data-toggle="selectpicker" data-defval="${page.pageSize!}" data-toggle-change="changepagesize" >
		    		<option value="15">15</option>
		        	<option value="30">30</option>
		        	<option value="50">50</option>
		        	<option value="100">100</option>
		    	</select>
			</div>
			<span>&nbsp;条，共 ${(page.totalRow)!0} 条</span>
		</div>
		<div class="pagination-box" data-toggle="pagination" data-total="${(page.totalRow)!0}" data-page-size="${(page.pageSize)!30}" data-page-current="${(page.pageCurrent)!1}">
		</div>
	</div>
</div>




